package com.cskaoyan.mall.bean;

/**
 * Created by Zsp
 * 2021/1/10
 */

public enum AdministorAuthority {

    ROLE_ID_1(1, "超级管理员"),
    ROLE_ID_2(2, "商场管理员"),
    ROLE_ID_3(3, "推广管理员"),
    ROLE_ID_10(10, "系统管理员"),
    ROLE_ID_11(11, "低级管理员1"),
    ROLE_ID_12(12, "社区管理员");

    private Integer roleId;
    private String authority;

    private AdministorAuthority(Integer roleId, String authority) {
        this.roleId = roleId;
        this.authority = authority;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public String getAuthority() {
        return authority;
    }

    public static AdministorAuthority getAdministorAuthority(Integer roleId) {
        for (AdministorAuthority value : AdministorAuthority.values()) {
            if (value.roleId == roleId) {
                return value;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return "AdministorAuthority{" +
                "roleId=" + roleId +
                ", authority='" + authority + '\'' +
                '}';
    }}
